package com.itheima.hmshopping.app.service;

import com.itheima.hmshopping.dto.OrderListDto;
import com.itheima.hmshopping.dubbo.api.OmsOrderServiceApi;
import com.itheima.hmshopping.entity.OmsOrder;
import com.itheima.hmshopping.util.HmPage;
import com.itheima.hmshopping.util.R;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class OmsOrderService {
    @DubboReference
    private OmsOrderServiceApi omsOrderServiceApi;

    /**
     * 查询订单
     * @param orderListDto
     * @return
     */
    public R<HmPage<OmsOrder>> getOrderList(OrderListDto orderListDto) {
        HmPage<OmsOrder> page=omsOrderServiceApi.getOrderList(orderListDto);
        return R.succeed(page,"查询订单成功");
    }

    /**
     * 批量删除订单
     * @param ids
     * @return
     */
    public R<String> deleteOrderByIds(Integer[] ids) {
        omsOrderServiceApi.deleteOrderByIds(ids);
        return R.succeed("","删除订单成功");
    }

    /**
     * 批量关闭订单
     * @param params
     * @return
     */
    public R<String> closeOrderByIds(Map<String, Object> params) {

        return null;
    }
}